package servlet;

import dao.GradeDao;
import vo.Grade;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.List;

/**
 * Created by ssw on 2018/6/17.
 */
public class AskScoreServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        HttpSession session=req.getSession();
        String scid=(String)session.getAttribute("scid");
        GradeDao gradeDao=new GradeDao();
//        根据scid 确定所有选了这门课的学生的成绩
        List<Grade> gradeList= gradeDao.askGradeList_teh(scid);
        req.setAttribute("gradeList", gradeList);
        req.getRequestDispatcher("sgms/lec_setCourseScore.jsp").forward(req, resp);

    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doPost(req, resp);
    }
}
